package com.ease.web.xwork2;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

/**
 * 
 * @author nathanleewei
 * 
 */
public class DebugInterceptor implements Interceptor {

	/**
	 * 
	 */
	private static final long serialVersionUID = -907666896129291150L;

	private static final Log log = LogFactory.getLog(DebugInterceptor.class);

	public void init() {
	}

	public String intercept(ActionInvocation invocation) throws Exception {
		log.debug("ThreadName:" + Thread.currentThread().getName() + "-> in " + invocation.getAction().getClass());
		String result = invocation.invoke();
		log.debug("ThreadName:" + Thread.currentThread().getName() + "-> out " + invocation.getAction().getClass());
		return result;
	}

	public void destroy() {
	}

}
